<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<% request.setCharacterEncoding("UTF-8"); %>
<% response.setCharacterEncoding("UTF-8"); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>添加新员工</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h3>添加新员工</h3>
<form action="/restCrud/emp" method="post">
    LastName: <input type="text" placeholder="请输入昵称" name="lastName"/>
    <br><br>
    Gender: <input type="radio" name="gender" value="M"/>男 <input type="radio" name="gender" value="W"/>女
    <br><br>
    Email: <input type="text" placeholder="xxx@xxx.com" name="email">
    <br><br>
    Department:
    <select name="department.id">
        <c:if test="${empty departments}">
            <option  value="null">暂无部门可选</option>
        </c:if>
        <c:if test="${!empty departments}">
            <c:forEach items="${departments}" var="department">
                <option value="${department.id}">${department.departName}</option>
            </c:forEach>
        </c:if>
    </select>
    <br><br>
    <input type="submit" value="确定新增"/>
</form>
</body>
</html>
